ATTACKER:=attacker

ATTACKER_BASEDIR:=$(BASEDIR)/$(ATTACKER)

ATTACKER_CC:=g++
ATTACKER_LD:=g++

ATTACKER_MODULES_DEPENDENCIES:=common mythread myfile message bridgenet mynet

ATTACKER_INCFLAGS:=-I$(ATTACKER_BASEDIR)/inc $(patsubst %, -I$(BASEDIR)/%/inc, $(ATTACKER_MODULES_DEPENDENCIES))

ATTACKER_DEBUG_CFLAGS:=-g -Wall -W -Woverloaded-virtual -O0 -Wfatal-errors -DDEBUG $(ATTACKER_INCFLAGS)
ATTACKER_DEBUG_LDFLAG:=-Wl,-R$(BASEDIR)/lib/debug -L$(BASEDIR)/lib/debug
ATTACKER_DEBUG_LIBS:=-lpthread -lrt -lcurl $(patsubst %, -l%, $(ATTACKER_MODULES_DEPENDENCIES))

ATTACKER_RELEASE_CFLAGS:= -Wall -W -Woverloaded-virtual -DRELEASE $(ATTACKER_INCFLAGS)
ATTACKER_RELEASE_LDFLAG:=-L$(BASEDIR)/lib/release
ATTACKER_RELEASE_LIBS:=$(patsubst %, -l%, $(ATTACKER_MODULES_DEPENDENCIES)) -lpthread -lrt -lcurl


ATTACKER_SRC:=$(shell ls 2>&1 $(ATTACKER_BASEDIR)/src/*.cpp)
TMP_ATTACKER_OBJS:= $(patsubst %.cpp, %.o, $(filter %.cpp, $(ATTACKER_SRC)))
TMP_ATTACKER_OBJSR:= $(ATTACKER_BASEDIR)/obj/release/bridgeconn.o $(ATTACKER_BASEDIR)/obj/release/workermanager.o $(ATTACKER_BASEDIR)/obj/release/attackworker.o $(ATTACKER_BASEDIR)/obj/release/hvyattackworker.o
TMP_ATTACKER_DEPS:= $(patsubst %.cpp, %.d, $(filter %.cpp, $(ATTACKER_SRC)))

ATTACKER_DEBUG_OBJS:= $(shell echo $(TMP_ATTACKER_OBJS) | sed -e 's@src@obj/debug@g')
ATTACKER_RELEASE_OBJS:= $(shell echo $(TMP_ATTACKER_OBJSR) | sed -e 's@src@obj/release@g')

SRC+=$(ATTACKER_SRC)
DEBUG_OBJS+=$(ATTACKER_DEBUG_OBJS)
RELEASE_OBJS+=$(ATTACKER_RELEASE_OBJS)

#Dependencies are release independent
DEPS+=$(shell 2>&1 echo $(TMP_ATTACKER_DEPS) | sed -e 's@src@dep@g')

DEBUG_TARGETS+=$(PREFIX)bin/debug/$(ATTACKER)
RELEASE_TARGETS+=$(PREFIX)bin/release/$(ATTACKER)1
RELEASE_TARGETS+=$(PREFIX)bin/release/$(ATTACKER)2
RELEASE_TARGETS+=$(PREFIX)bin/release/$(ATTACKER)3
RELEASE_TARGETS+=$(PREFIX)bin/release/$(ATTACKER)4
RELEASE_TARGETS+=$(PREFIX)bin/release/$(ATTACKER)5
RELEASE_TARGETS+=$(PREFIX)bin/release/$(ATTACKER)6
RELEASE_TARGETS+=$(PREFIX)bin/release/$(ATTACKER)7
